package com.hx.mylombok.factory;

import com.hx.mylombok.task.FileTask;
import com.hx.mylombok.task.TaskEnum;
import com.hx.mylombok.task.impl.*;
/**
 * @author guoxiaolin
 * @description
 * @since 2019/3/27 15:10
 */
public class FileGenerateFactory {

    public FileTask getTask(Enum filename, String classname){

        if (filename == null){
            return null;
        }
        if (filename.equals(TaskEnum.PROXYCONTROLLER)){
            return new ProxyControllerTask(classname);
        }
        if (filename.equals(TaskEnum.CONTROLLER)){
            return new ControllerTask(classname);
        }
        if (filename.equals(TaskEnum.FEIGNPROXYFALLBACK)){
            return new FeignProxyFallbackTask(classname);
        }
        if (filename.equals(TaskEnum.PROXY)){
            return new ProxyTask(classname);
        }
        if (filename.equals(TaskEnum.IFEIGNPROXY)){
            return new FeignProxyTask(classname);
        }
        if (filename.equals(TaskEnum.REPOSITORY)){
            return new RepositoryTask(classname);
        }
        if (filename.equals(TaskEnum.ABSTRACTSERVICE)){
            return new AbstractServiceTask(classname);
        }
        if (filename.equals(TaskEnum.IMPLSERVICE)){
            return new ImplServiceTask(classname);
        }
        return null;
    }
}
